# plugins/demo_plugin/app/user/controller/order/CreateOrder.py
from core.plugin_loader import route

@route(path="/create-order", method="GET")
async def get(user_id: int=111):  # 声明查询参数（需设置默认值或标记为必需）
    return {"user_id": user_id}

# 显式指定路径（可选）
@route(path="/submit", method="POST")  # 路径：/plugins/demo_plugin/user/order/CreateOrder/submit
async def post(data: dict):
    return {"message": "提交订单", "data": data}
@route(path="/getUser/{user_id}", method="GET")  # 路径参数 user_id
async def get_user(user_id: int):
    return {"user_id": user_id}